package com.example.zhihu.entity;

import com.alibaba.fastjson.annotation.JSONField;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author t-zhaoheng
 * @since 2022/5/5
 * 知乎的周数据
 */
@NoArgsConstructor
@Data
public class HotDataWeek {
  @JSONField(name = "data")
  private List<DataDTO> data;
  @JSONField(name = "paging")
  private PagingDTO paging;

  @NoArgsConstructor
  @Data
  public static class PagingDTO {

    @JSONField(name = "is_end")
    private Boolean isEnd;
    @JSONField(name = "is_start")
    private Boolean isStart;
    @JSONField(name = "next")
    private String next;
    @JSONField(name = "previous")
    private String previous;
    @JSONField(name = "totals")
    private Integer totals;
  }

  @NoArgsConstructor
  @Data
  public static class DataDTO {

    @JSONField(name = "question")
    private QuestionDTO question;
    @JSONField(name = "reaction")
    private ReactionDTO reaction;

    @NoArgsConstructor
    @Data
    public static class QuestionDTO {

      @JSONField(name = "url")
      private String url;
      @JSONField(name = "created")
      private Integer created;
      @JSONField(name = "updated_time")
      private Integer updatedTime;
      @JSONField(name = "title")
      private String title;
      @JSONField(name = "highlight_title")
      private String highlightTitle;
      @JSONField(name = "type")
      private String type;
      @JSONField(name = "id")
      private String id;
      @JSONField(name = "token")
      private Integer token;
      @JSONField(name = "is_recent_hot")
      private Boolean isRecentHot;
      @JSONField(name = "have_answer")
      private Boolean haveAnswer;
      @JSONField(name = "question_answer_url")
      private String questionAnswerUrl;
      @JSONField(name = "topics")
      private List<TopicsDTO> topics;
      @JSONField(name = "label")
      private String label;
      @JSONField(name = "creator")
      private CreatorDTO creator;

      @NoArgsConstructor
      @Data
      public static class CreatorDTO {

        @JSONField(name = "url_token")
        private String urlToken;
        @JSONField(name = "name")
        private String name;
      }

      @NoArgsConstructor
      @Data
      public static class TopicsDTO {

        @JSONField(name = "url_token")
        private Integer urlToken;
        @JSONField(name = "name")
        private String name;
      }
    }

    @NoArgsConstructor
    @Data
    public static class ReactionDTO {

      @JSONField(name = "new_pv")
      private Integer newPv;
      @JSONField(name = "new_pv_7_days")
      private Integer newPv7Days;
      @JSONField(name = "new_follow_num")
      private Integer newFollowNum;
      @JSONField(name = "new_follow_num_7_days")
      private Integer newFollowNum7Days;
      @JSONField(name = "new_answer_num")
      private Integer newAnswerNum;
      @JSONField(name = "new_answer_num_7_days")
      private Integer newAnswerNum7Days;
      @JSONField(name = "new_upvote_num")
      private Integer newUpvoteNum;
      @JSONField(name = "new_upvote_num_7_days")
      private Integer newUpvoteNum7Days;
      @JSONField(name = "pv")
      private Integer pv;
      @JSONField(name = "follow_num")
      private Integer followNum;
      @JSONField(name = "answer_num")
      private Integer answerNum;
      @JSONField(name = "upvote_num")
      private Integer upvoteNum;
      @JSONField(name = "pv_incr_rate")
      private String pvIncrRate;
      @JSONField(name = "head_percent")
      private String headPercent;
      @JSONField(name = "new_pv_yesterday")
      private Integer newPvYesterday;
      @JSONField(name = "new_pv_t_yesterday")
      private Integer newPvTYesterday;
      @JSONField(name = "score")
      private Integer score;
      @JSONField(name = "score_level")
      private Integer scoreLevel;
      @JSONField(name = "text")
      private String text;
    }
  }
}
